#include "stdafx.h"
#include "BulletParticle.h"

namespace MyGame {

BulletParticle::BulletParticle(Game* game) : Quad(game) {
    this->SetEffectFile("TracerBullet.fx");
    this->SetRotation(D3DXVECTOR3(D3DX_PI / 2, 0, 0));
    this->SetScale(D3DXVECTOR3(0.1f, 3.0f, 1.0f));
    this->SetCullMode(D3DCULL_NONE);
    this->SetBillboard(true);
}

BulletParticle::~BulletParticle(void) {
}

void BulletParticle::Draw(FLOAT timeDelta) {
    D3DXMATRIX mWorld = this->GetWorldMatrix();
    D3DXMATRIX mWorldViewProjection = mWorld * this->GetGame()->GetCamera()->GetViewMatrix() * this->GetGame()->GetCamera()->GetProjectionMatrix();
    this->effect->SetMatrix("g_mWorldViewProjection", &mWorldViewProjection) ;
    this->effect->SetTechnique("Particle_Shader_Normal_Alpha");
    __super::Draw(timeDelta);
}

}
